数字货币交易所开发源码分享:
from_user_id = $data["from_user_id"];$transaction->to_user_id = $data["to_user_id"];$transaction->type = empty($data["type"]) ? 1 : $data["type"];$transaction->number = $data["number"];$transaction->remarks = $data["remarks"];$transaction->time = time();$transaction->status = 1;if ($transaction->save()) {return true;} else {return false;}}public static function pushNews($currency_id, $legal_id){$in = TransactionIn::with(['legalcoin', 'currencycoin'])->where("number", ">", 0)->where("currency", $currency_id)->where("legal", $legal_id)->groupBy('currency', 'legal', 'price')->orderBy('price', 'desc')->select(['currency','legal','price',])->selectRaw('sum(`number`) as `number`')->limit(5)->get()->toArray();$out = TransactionOut::with(['legalcoin', 'currencycoin'])->where("number", ">", 0)->where("currency", $currency_id)->where("legal", $legal_id)->groupBy('currency', 'legal', 'price')->orderBy('price', 'asc')->select(['currency','legal','price',])->selectRaw('sum(`number`) as `number`')->limit(5)->get()->toArray();krsort($out);$out_data = https://tazarkount.com/read/array();foreach ($out as $o) {array_push($out_data, $o);}$last_price = 0;$last = TransactionComplete::orderBy('id', 'desc')->where("currency", $currency_id)->where("legal", $legal_id)->first();if (!empty($last)) {$last_price = $last->price;}$send = array("type" => "transaction","in" => json_encode($in),"out" => json_encode($out_data),"last_price" => $last_price,"currency_id" => $currency_id,"legal_id" => $legal_id);return UserChat::sendChat($send);}public function getFromAddressAttribute(){return $this->hasOne('App\UsersWallet', 'user_id', 'from_user_id')->value('address');}public function getToAddressAttribute(){return $this->hasOne('App\UsersWallet', 'user_id', 'to_user_id')->value('address');}public function getFromAccountAttribute(){return $this->hasOne('App\Users', 'id', 'from_user_id')->value('account_number');}public function getToAccountAttribute(){return $this->hasOne('App\Users', 'id', 'to_user_id')->value('account_number');}public function getTimeAttribute(){$value = https://tazarkount.com/read/$this->attributes['time'];return $value ? date('Y-m-d H:i:s', $value) : '';}public function getCurrencyNameAttribute(){return $this->hasOne('App\Currency', 'id', 'currency')->value('name');}//获取交易总额public function getTotalAttribute(){$number = $this->attributes['number'];$price = $this->attributes['price'];$tol = $number * $price;return $tol;}} 【数字货币交易所--数字货币交易所系统开发源码分享】
- 春季老年人吃什么养肝?土豆、米饭换着吃
- 三八妇女节节日祝福分享 三八妇女节节日语录
- 老人谨慎!选好你的“第三只脚”
- 校方进行了深刻的反思 青岛一大学生坠亡校方整改校规
- 脸皮厚的人长寿!有这特征的老人最长寿
- 长寿秘诀:记住这10大妙招 100%增寿
- 春季老年人心血管病高发 3条保命要诀
- 眼睛花不花要看四十八 老年人怎样延缓老花眼
- 香槟然能防治老年痴呆症? 一天三杯它人到90不痴呆
- 老人手抖的原因 为什么老人手会抖
