__('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']; 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(); return compact('count', 'data'); } }