12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- /**
- *
- * User: anyluck
- * Date: 2020/6/2
- * Time: 17:41
- */
- namespace app\admin\controller;
- use think\facade\Request;
- use think\facade\View;
- class Order
- {
- // 订单管理
- /**
- * 求购订单列表
- */
- public function buy()
- {
- if (Request::isPost()) {
- $name = input("name");
- $page = input("page") ?: 1;
- $limit = input("limit") ?: 10;
- $where = [];
- // if ($name){
- // $where["name"]=["like","% $name %"];
- // }
- $where["status"]=0;
- $list = \app\common\model\Order::where($where)->order("id desc")->paginate(["list_row" => $limit, "page" => $page])->each(function ($item) {
- $user = \app\common\model\User::where(["id" => $item["buy_user"]])->field("name")->find();
- $item["user_name"] = $user->name;
- $item["add_time"]=date("Y-m-d H:i:s",$item["add_time"]);
- return $item;
- })->toArray();
- return $result = ['code' => 0, 'msg' => lang('get info success'), 'data' => $list['data'] ?: [], 'count' => $list['total'] ?: 0];
- }
- return View::fetch();
- }
- /**
- * 持有订单列表
- */
- public function push()
- {
- }
- /**
- * 申述处理
- */
- public function bond()
- {
-
- }
- }
|