__('Is_open 0'), '1' => __('Is_open 1')]; } public static function getNewCode() { do { list($msec, $sec) = explode(' ', microtime()); $msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', ''); $orderId = 'qy' . $msectime . mt_rand(10000, 99999); } while (self::where(['contract_code' => $orderId])->find()); return $orderId; } // public static function plan_lst($where) // { // $model = new self; // $xwhere = null; // $order = "id desc"; // if (isset($where['uid']) && $where['uid'] > 0) $xwhere['uid'] = $where['uid']; // if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid']; // $data = $model->where($xwhere)->where('is_signing',0)->order($order)->field('plan_id')->select(); // var_dump($data); // $plan=new WechatPlan(); // $data2=$plan->where('plan_id','in',['188873'])->select(); // var_dump($data2);die(); //// $count = $plan->where('id','in',$data)->count(); // return $data2; // } public static function record_lst($where) { $model = new self; $xwhere = null; $order = "id desc"; if (isset($where['uid']) && $where['uid'] > 0) $xwhere['uid'] = $where['uid']; if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid']; $data = $model->where($xwhere)->where('is_signing',0)->order($order)->select(); $count = $model->where($xwhere)->count(); return compact('count', 'data'); } public static function record_info($where) { $model = new self; $xwhere = null; $order = "id desc"; if (isset($where['id']) && $where['id'] > 0) $xwhere['id'] = $where['id']; if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid']; if (isset($where['uid']) && $where['uid'] > 0) $xwhere['uid'] = $where['uid']; // if (isset($where['category_id']) && $where['category_id'] > 0) $xwhere['category_id'] = $where['category_id']; $data = $model->where($xwhere)->where('is_signing',0)->order($order)->select(); $count = $model->where($xwhere)->count(); $lave = new Lave(); $list = $lave->where('user_id', $data[0]['uid'])->where('cid',$data[0]['cid'])->where('order_name', $data[0]['order_name'])->select(); return compact('count', 'data','list'); } }