setAttr('id', null)->isUpdate(false)->allowField(true)->save($arr); return $this->id; } /* * 20210625 */ public function updpaytimebypreid($preid) { $where_arr['prepay_id'] = $preid; $where_arr['orderstatus'] = 0; $update_arr['ispay'] = 1; $update_arr['orderstatus'] = 1; $update_arr['paytime'] = date('Y-m-d H:i:s'); $this->where($where_arr)->update($update_arr); } /* * 20210627 */ public function updorederstatusbyorderno($orderno, $openid, $updarr) { $where_arr['outorderno'] = $orderno; $where_arr['openid'] = $openid; $where_arr['orderstatus'] = 0; $rcount = $this->where($where_arr)->update($updarr); return $rcount; } /* * 20210814 */ public function selinfobyorder($orderno) { $where_arr['outorderno'] = $orderno; $rec = $this->where($where_arr)->find(); return $rec; } /** * 根据订单id改订单信息 * 20211108 * wj */ public function updorederstatusbyid($id, $updarr) { $where_arr['id'] = $id; $where_arr['orderstatus'] = 0; $rcount = $this->where($where_arr)->update($updarr); return $rcount; } /** * 获取订单总量 * 202112228 * wj */ public function getcount() { $count = $this->where([])->count(); return $count; } /** * 获取分析数据 * 20211117 * wj */ public function statistics() { $sql = "select ispay,count(*) as count from " . $this->table . " group by ispay"; $list = $this->query("select * from (" . $sql . ") as t"); return $list; } /* * 20211228 * wj */ public function getList($where = [], $field = "*", $page = 1, $size = 10, $order = "id desc", $group = "", $row = false) { $sqlObj = $this->alias('po')->join("t_userinfo u", "po.wid=u.id")->where($where); if ("count" != $field) { $sqlObj = $sqlObj->field($field)->order($order)->group($group)->page($page, $size); if ($row) { $data = $sqlObj->find(); } else { $data = $sqlObj->select(); } } else { $data = $sqlObj = $sqlObj->count(); } return $data; } }