$oid, 'cart_id' => $cart['id'], 'product_id' => $cart['productInfo']['id'], 'cart_info' => json_encode($cart), 'unique' => md5($cart['id'] . '' . $oid) ]; } return self::setAll($group); } /** * 得到还没参加挖矿的一个订单号 * * @param $uid * @return mixed */ public static function getMiningOrderId($uid) { $row = self::where('so.uid', $uid) ->where('so.paid', 1) ->where('so.status', '>=', 0) ->where('so.refund_status', 0) ->where('so.is_del', 0) ->where('so.is_system_del', 0) ->where('ci.mine', 0) ->alias('ci')->join('store_order so', 'ci.oid=so.id')->field('ci.oid')->limit(1)->value('oid'); return $row; } /** * 标记为已参加挖矿 * * @param $orderId * @return StoreOrderCartInfo */ public static function setMining($orderId, $mine = 1) { return self::where('oid', $orderId)->update(['mine' => $mine]); } }