diff --git a/application/admin/controller/manystore/Index.php b/application/admin/controller/manystore/Index.php index 57cd125..ab09ff4 100644 --- a/application/admin/controller/manystore/Index.php +++ b/application/admin/controller/manystore/Index.php @@ -504,6 +504,7 @@ class Index extends Backend throw new \Exception("机构或个人认证用户已存在或被其他机构占用,请更改!"); } + }else{ //新增 diff --git a/application/admin/controller/manystore/LakalaBusiness.php b/application/admin/controller/manystore/LakalaBusiness.php new file mode 100644 index 0000000..0b3a31d --- /dev/null +++ b/application/admin/controller/manystore/LakalaBusiness.php @@ -0,0 +1,222 @@ +model = new \app\admin\model\manystore\LakalaBusiness; + parent::_initialize(); + + $this->view->assign("statusList", $this->model->getStatusList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 查看 + */ + public function index() + { + //当前是否为关联查询 + $this->relationSearch = true; + //设置过滤方法 + $this->request->filter(['strip_tags', 'trim']); + if ($this->request->isAjax()) { + //如果发送的来源是Selectpage,则转发到Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + + $list = $this->model + ->with(['manystore','shop']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('manystore')->visible(['nickname']); + $row->getRelation('shop')->visible(['name','logo']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + + + + /** + * 添加 + * + * @return string + * @throws \think\Exception + */ + public function add() + { + if (false === $this->request->isPost()) { + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + + if ($this->dataLimit && $this->dataLimitFieldAutoFill) { + $params[$this->dataLimitField] = $this->auth->id; + } + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException()->validate($validate); + } + + $shop_id = $params["shop_id"]; + if(!$params["shop_id"] && !$params["user_id"]) throw new \Exception("必须选填店铺或者用户!"); + if($shop_id){ + $manystore = Manystore::where("shop_id",$shop_id)->find(); + if(!$manystore){ + throw new \Exception("店铺不存在"); + } +// if(!(new \app\common\model\dyqc\ManystoreShop)->checkFull($shop_id))throw new \Exception("对方的认证信息未完善,请您先去帮忙完善!"); + $params["store_id"] = $manystore["id"]; + $params["user_id"] = $manystore["user_id"]; + } + if($params["user_id"]){ + $manystore = Manystore::where("user_id",$params["user_id"])->find(); + if($manystore){ + $params["store_id"] = $manystore["id"]; + $params["shop_id"] = $manystore["shop_id"]; + } + } + + + $result = $this->model->allowField(true)->save($params); + + User::where("id" ,$params["user_id"])->update(["business_type"=>"1"]); + + Db::commit(); + } catch (ValidateException|PDOException|\Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($result === false) { + $this->error(__('No rows were inserted')); + } + $this->success(); + } + + /** + * 编辑 + * + * @param $ids + * @return string + * @throws DbException + * @throws \think\Exception + */ + public function edit($ids = null) + { + $row = $this->model->get($ids); + if (!$row) { + $this->error(__('No Results were found')); + } + $adminIds = $this->getDataLimitAdminIds(); + if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) { + $this->error(__('You have no permission')); + } + if (false === $this->request->isPost()) { + $this->view->assign('row', $row); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; + $row->validateFailException()->validate($validate); + } + + $shop_id = $params["shop_id"]; + if(!$params["shop_id"] && !$params["user_id"]) throw new \Exception("必须选填店铺或者用户!"); + if($shop_id){ + $manystore = Manystore::where("shop_id",$shop_id)->find(); + if(!$manystore){ + throw new \Exception("店铺不存在"); + } +// if(!(new \app\common\model\dyqc\ManystoreShop)->checkFull($shop_id))throw new \Exception("对方的认证信息未完善,请您先去帮忙完善!"); + $params["store_id"] = $manystore["id"]; + $params["user_id"] = $manystore["user_id"]; + } + if($params["user_id"]){ + $manystore = Manystore::where("user_id",$params["user_id"])->find(); + if($manystore){ + $params["store_id"] = $manystore["id"]; + $params["shop_id"] = $manystore["shop_id"]; + } + } + + User::where("id" ,$row["user_id"])->update(["business_type"=>"2"]); + + $result = $row->allowField(true)->save($params); + User::where("id" ,$params["user_id"])->update(["business_type"=>"1"]); + + Db::commit(); + } catch (ValidateException|PDOException|\Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if (false === $result) { + $this->error(__('No rows were updated')); + } + $this->success(); + } + +} diff --git a/application/admin/controller/school/activity/order/OrderCode.php b/application/admin/controller/school/activity/order/OrderCode.php index a472920..ef6b0d1 100644 --- a/application/admin/controller/school/activity/order/OrderCode.php +++ b/application/admin/controller/school/activity/order/OrderCode.php @@ -62,7 +62,7 @@ class OrderCode extends Backend foreach ($list as $row) { - $row->getRelation('order')->visible(['order_no',"status"]); + $row->getRelation('order')->visible(['order_no',"status","desc"]); $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); $row->getRelation('orderuser')->visible(['nickname','mobile','avatar']); } diff --git a/application/admin/lang/zh-cn/manystore/lakala_business.php b/application/admin/lang/zh-cn/manystore/lakala_business.php new file mode 100644 index 0000000..2b65c36 --- /dev/null +++ b/application/admin/lang/zh-cn/manystore/lakala_business.php @@ -0,0 +1,24 @@ + '申请的机构id', + 'Store_id' => '机构管理ID', + 'Status' => '类型', + 'Status 1' => '生产环境', + 'Set status to 1' => '设为生产环境', + 'Status 2' => '沙箱测试环境', + 'Set status to 2' => '设为沙箱测试环境', + 'Merchant_no' => '拉卡拉商户号', + 'Online_scanning_terminal_no' => '线上扫码终端号', + 'Offline_scanning_terminal_no' => '线下扫码终端号', + 'Quick_terminal_no' => '快捷终端号', + 'Online_banking_terminal_no' => '网银终端号', + 'Offline_pos_terminal_no' => '线下POS终端号', + 'Desc' => '备注', + 'Createtime' => '创建时间', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间', + 'Manystore.nickname' => '昵称', + 'Shop.name' => '店铺名称', + 'Shop.logo' => '品牌LOGO' +]; diff --git a/application/admin/model/manystore/LakalaBusiness.php b/application/admin/model/manystore/LakalaBusiness.php new file mode 100644 index 0000000..306e3a4 --- /dev/null +++ b/application/admin/model/manystore/LakalaBusiness.php @@ -0,0 +1,60 @@ + __('Status 1'), '2' => __('Status 2')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + + + public function manystore() + { + return $this->belongsTo('app\admin\model\Manystore', 'store_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function shop() + { + return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/validate/manystore/LakalaBusiness.php b/application/admin/validate/manystore/LakalaBusiness.php new file mode 100644 index 0000000..8331043 --- /dev/null +++ b/application/admin/validate/manystore/LakalaBusiness.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/manystore/lakala_business/add.html b/application/admin/view/manystore/lakala_business/add.html new file mode 100644 index 0000000..69fc503 --- /dev/null +++ b/application/admin/view/manystore/lakala_business/add.html @@ -0,0 +1,92 @@ +
+ +
+ +
+ + + + + + (机构和用户选填其一 ,没找到机构则点击按钮创建机构后重新下拉框选机构) + {:__('Add')} + + +
+
+ +
+ +
+ + + + (机构和用户选填其一 ,没找到用户则点击按钮创建用户后重新下拉框选用户) + 根据手机号生成用户 + + +
+
+ + +
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/manystore/lakala_business/edit.html b/application/admin/view/manystore/lakala_business/edit.html new file mode 100644 index 0000000..625f4da --- /dev/null +++ b/application/admin/view/manystore/lakala_business/edit.html @@ -0,0 +1,93 @@ +
+ +
+ +
+ + + + + + (机构和用户选填其一 ,没找到机构则点击按钮创建机构后重新下拉框选机构) + {:__('Add')} + + +
+
+
+ +
+ + + + + (机构和用户选填其一 ,没找到用户则点击按钮创建用户后重新下拉框选用户) + 根据手机号生成用户 + + + +
+ +
+ +
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/manystore/lakala_business/index.html b/application/admin/view/manystore/lakala_business/index.html new file mode 100644 index 0000000..7562a17 --- /dev/null +++ b/application/admin/view/manystore/lakala_business/index.html @@ -0,0 +1,46 @@ +
+ +
+ {:build_heading(null,FALSE)} + +
+ + +
+
+
+
+
+ + {:__('Add')} + {:__('Edit')} + {:__('Delete')} + + + + + {:__('Recycle bin')} +
+ +
+
+
+ +
+
+
diff --git a/application/admin/view/manystore/lakala_business/recyclebin.html b/application/admin/view/manystore/lakala_business/recyclebin.html new file mode 100644 index 0000000..62f51b5 --- /dev/null +++ b/application/admin/view/manystore/lakala_business/recyclebin.html @@ -0,0 +1,25 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/api/controller/school/newactivity/Pay.php b/application/api/controller/school/newactivity/Pay.php index 62ed246..319989c 100644 --- a/application/api/controller/school/newactivity/Pay.php +++ b/application/api/controller/school/newactivity/Pay.php @@ -40,7 +40,7 @@ class Pay extends Base * @ApiSummary(活动第三方支付(微信等支付)) * @ApiMethod(POST) * @ApiParams(name = "order_no", type = "string",required=true,description = "订单id或订单号") - * @ApiParams(name = "type", type = "string",required=true,description = "服务商:alipay=支付宝,wechat=微信") + * @ApiParams(name = "type", type = "string",required=true,description = "服务商:alipay=支付宝,wechat=微信,lakala=拉卡拉支付") * @ApiParams(name = "platform", type = "string",required=true,description = "平台:web=PC网页支付,wap=H5手机网页支付,app=APP支付,scan=扫码支付,mp=微信公众号支付,miniapp=微信小程序支付") * @ApiParams(name = "openid", type = "string",required=false,description = "用户openid(非必填)") * @ApiReturn({ @@ -56,6 +56,12 @@ class Pay extends Base $method = $this->request->post('platform/s'); $openid = $this->request->post('openid/s', ""); $platform = $method; + $lakala = false; + if($type == "lakala"){ + $lakala = true; + } + + try { //订单支付前校验 $this->model->checkPay($order_no,$type); @@ -86,7 +92,7 @@ class Pay extends Base // 没有 openid 默认拿下单人的 openid $oauth = Third::where([ 'user_id' => $order->user_id, - 'platform' => $type, + 'platform' => $type == "lakala" ? "wechat" : $type, 'apptype' => $platform ])->find(); diff --git a/application/common/model/manystore/LakalaBusiness.php b/application/common/model/manystore/LakalaBusiness.php new file mode 100644 index 0000000..e944112 --- /dev/null +++ b/application/common/model/manystore/LakalaBusiness.php @@ -0,0 +1,75 @@ + __('Status 1'), '2' => __('Status 2')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + + + public function manystore() + { + return $this->belongsTo('app\admin\model\Manystore', 'store_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function shop() + { + return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + public static function checkBind($user_id,$check=false){ + //判断是否对接了lakala进件 + if(config("site.activity_price_lakala_switch") || $check){ + if(config("site.activity_pay_process") == "lakala" || $check){ + $lakalaBusiness = self::where("user_id",$user_id)->find(); + if(!$lakalaBusiness){ + throw new \Exception("当前商户未完成拉卡拉进件以及平台绑定!"); + } + } + } + } + + +} diff --git a/application/common/model/school/activity/Activity.php b/application/common/model/school/activity/Activity.php index c5a4e63..676e029 100644 --- a/application/common/model/school/activity/Activity.php +++ b/application/common/model/school/activity/Activity.php @@ -3,6 +3,7 @@ namespace app\common\model\school\activity; +use app\common\model\manystore\LakalaBusiness; use app\common\library\Virtual; use app\common\model\BaseModel; use app\common\model\school\activity\order\Order; @@ -649,6 +650,9 @@ class Activity extends BaseModel } + //判断是否对接了lakala进件 + LakalaBusiness::checkBind($params["user_id"]); + } if($params["price"]<0)$params["price"]=0; diff --git a/application/common/model/school/activity/order/Order.php b/application/common/model/school/activity/order/Order.php index 0e30ed7..f8456a8 100644 --- a/application/common/model/school/activity/order/Order.php +++ b/application/common/model/school/activity/order/Order.php @@ -6,6 +6,7 @@ use addons\epay\library\Service; use app\admin\model\Admin; use app\admin\model\Manystore; use app\common\model\BaseModel; +use app\common\model\manystore\LakalaBusiness; use app\common\model\school\activity\Activity; use app\common\model\school\activity\Cate; use app\common\model\school\activity\Refund; @@ -1241,6 +1242,12 @@ class Order extends BaseModel case "offline": //线下支付 //.. break; + case "lakala": //拉卡拉支付 + $activity = Activity::where("id",$order['activity_id'])->find(); + if(!$activity) throw new \Exception("此订单未关联活动"); + //判断是否对接了lakala进件 + LakalaBusiness::checkBind($activity["user_id"],true); + break; case "yue": //余额支付 //支付密码判断 // $res = User::checkPayPassword($order['user_id'],$password,true); diff --git a/application/extra/upload.php b/application/extra/upload.php index 64a43cc..834d01b 100644 --- a/application/extra/upload.php +++ b/application/extra/upload.php @@ -22,7 +22,7 @@ return [ /** * 可上传的文件类型 */ - 'mimetype' => 'jpg,svg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm,p12,pem,doc,docx,xls,xlsx,pdf,txt,md,xml', + 'mimetype' => 'jpg,svg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm,p12,pem,doc,docx,xls,xlsx,pdf,txt,md,xml,cer', /** * 是否支持批量上传 */ diff --git a/application/manystore/controller/school/activity/order/OrderCode.php b/application/manystore/controller/school/activity/order/OrderCode.php index f34a88f..9a368e1 100644 --- a/application/manystore/controller/school/activity/order/OrderCode.php +++ b/application/manystore/controller/school/activity/order/OrderCode.php @@ -62,7 +62,7 @@ class OrderCode extends ManystoreBase foreach ($list as $row) { - $row->getRelation('schoolactivityorder')->visible(['order_no','pay_no',"status"]); + $row->getRelation('schoolactivityorder')->visible(['order_no','pay_no',"status","desc"]); $row->getRelation('user')->visible(['nickname','mobile','avatar']); $row->getRelation('schoolactivity')->visible(['title','images']); $row->getRelation('orderuser')->visible(['nickname','mobile','avatar']); diff --git a/extend/bw/lakala/LakalaService.php b/extend/bw/lakala/LakalaService.php new file mode 100644 index 0000000..1d5a7fe --- /dev/null +++ b/extend/bw/lakala/LakalaService.php @@ -0,0 +1,36 @@ +init(); + } + private function __clone() + { + return; + } + public static function getInstance() + { + if (!(self::$instance instanceof self)) { + self::$instance = new self(); + } + return self::$instance; + } + public function init() + { + $this->config = [ + 'merId' => '100000000000000', + 'merKey' => '12345678901234567890123456789012', + ]; + } + +} \ No newline at end of file diff --git a/public/assets/js/backend/manystore/index.js b/public/assets/js/backend/manystore/index.js index 1f01da3..1d45370 100644 --- a/public/assets/js/backend/manystore/index.js +++ b/public/assets/js/backend/manystore/index.js @@ -51,6 +51,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'username', title: __('Username')}, {field: 'nickname', title: __('Nickname')}, {field: 'email', title: __('Email')}, + + {field: 'user.business_type', title: __('商户进件完善'), searchList: {"1":__('已完善'),"2":__('未完善')}, formatter: Table.api.formatter.status}, + {field: 'status', title: __("Status"), formatter: Table.api.formatter.status}, {field: 'shop.status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, {field: 'user_id', title: __('User_id')}, @@ -144,6 +147,25 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // } // return false; }}, + + { + name: 'lakala_business', + text: __('拉卡拉进件信息设置'), + title: __('拉卡拉进件信息设置'), + classname: 'btn btn-dialog', + icon: 'fa fa-cart-arrow-down', + dropdown : '更多', + url: lakala_business_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + + + // {name: 'freeapi', // text: '免登录进入机构API版后台', // icon: 'fa fa-sign-in', @@ -185,37 +207,37 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // // return row.status == '2'||row.status == '3'; // // } // }, - // { - // name: 'activity', - // text: __('机构线上活动'), - // title: __('机构线上活动'), - // classname: 'btn btn-dialog', - // icon: 'fa fa-leanpub', - // dropdown : '更多', - // url: activity_url, - // callback: function (data) { - // - // }, - // // visible: function (row) { - // // return row.paytime; - // // } - // }, - // - // { - // name: 'teacher', - // text: __('主讲老师信息'), - // title: __('主讲老师信息'), - // classname: 'btn btn-dialog', - // icon: 'fa fa-user', - // dropdown : '更多', - // url: teacher_url, - // callback: function (data) { - // - // }, - // // visible: function (row) { - // // return row.status == '2'||row.status == '3'; - // // } - // }, + { + name: 'activity', + text: __('机构活动'), + title: __('机构活动'), + classname: 'btn btn-dialog', + icon: 'fa fa-leanpub', + dropdown : '更多', + url: activity_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + + { + name: 'user', + text: __('申请用户信息'), + title: __('申请用户信息'), + classname: 'btn btn-dialog', + icon: 'fa fa-user', + dropdown : '更多', + url: user_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, // { // name: 'verification', // text: __('核销员信息'), @@ -462,8 +484,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin var virtual_user_url = function (row,dom) { return 'school/classes/virtual_user/index?shop_id='+row.shop_id; } - var teacher_url = function (row,dom) { - return 'school/classes/teacher/index?shop_id='+row.shop_id; + var user_url = function (row,dom) { + return 'user/user/index?id='+row.user_id; } @@ -494,8 +516,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return 'school/classes/activity/order/order/index?shop_id='+row.shop_id; } + var lakala_business_url = function (row,dom) { + return 'manystore/lakala_business/index?user_id='+row.user_id; + } + var activity_url = function (row,dom) { - return 'school/classes/activity/activity/index?shop_id='+row.shop_id; + return 'school/activity/activity/index?user_id='+row.user_id; } diff --git a/public/assets/js/backend/manystore/lakala_business.js b/public/assets/js/backend/manystore/lakala_business.js new file mode 100644 index 0000000..5f9bba2 --- /dev/null +++ b/public/assets/js/backend/manystore/lakala_business.js @@ -0,0 +1,169 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'manystore/lakala_business/index' + location.search, + add_url: 'manystore/lakala_business/add'+ location.search, + edit_url: 'manystore/lakala_business/edit', + del_url: 'manystore/lakala_business/del', + multi_url: 'manystore/lakala_business/multi', + import_url: 'manystore/lakala_business/import', + table: 'manystore_lakala_business', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + // {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'}, + // {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'}, + // {field: 'shop.logo', title: __('Logo'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + + {field: 'shop_id',visible:false, title: __('Shop_id')}, + {field: 'store_id',visible:false, title: __('Store_id')}, + {field: 'user_id', title: __('申请用户id')}, + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, + {field: 'merchant_no', title: __('Merchant_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'online_scanning_terminal_no', title: __('Online_scanning_terminal_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'offline_scanning_terminal_no', title: __('Offline_scanning_terminal_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'quick_terminal_no', title: __('Quick_terminal_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'online_banking_terminal_no', title: __('Online_banking_terminal_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'offline_pos_terminal_no', title: __('Offline_pos_terminal_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + ] + ] + }); + + + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = ['98%','98%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); + // 为表格绑定事件 + Table.api.bindevent(table); + }, + recyclebin: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + 'dragsort_url': '' + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: 'manystore/lakala_business/recyclebin' + location.search, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + { + field: 'deletetime', + title: __('Deletetime'), + operate: 'RANGE', + addclass: 'datetimerange', + formatter: Table.api.formatter.datetime + }, + { + field: 'operate', + width: '140px', + title: __('Operate'), + table: table, + events: Table.api.events.operate, + buttons: [ + { + name: 'Restore', + text: __('Restore'), + classname: 'btn btn-xs btn-info btn-ajax btn-restoreit', + icon: 'fa fa-rotate-left', + url: 'manystore/lakala_business/restore', + refresh: true + }, + { + name: 'Destroy', + text: __('Destroy'), + classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit', + icon: 'fa fa-times', + url: 'manystore/lakala_business/destroy', + refresh: true + } + ], + formatter: Table.api.formatter.operate + } + ] + ] + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + }, + + add: function () { + Controller.api.bindevent(); + }, + edit: function () { + Controller.api.bindevent(); + }, + api: { + bindevent: function () { + + $(document).on('click', '.btn-changeuser', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var title = $(this).attr('title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + // var ids = $(this).attr('data-id'); + var area = ['98%','98%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果; + Fast.api.close(ret); + } + }; + Fast.api.open(url,title,options); + }); + + Form.api.bindevent($("form[role=form]")); + } + } + }; + return Controller; +}); diff --git a/public/assets/js/backend/school/activity/order/order_code.js b/public/assets/js/backend/school/activity/order/order_code.js index 5a3e474..e73929c 100644 --- a/public/assets/js/backend/school/activity/order/order_code.js +++ b/public/assets/js/backend/school/activity/order/order_code.js @@ -41,6 +41,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'idnum', title: __('身份证号'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'orderuser.mobile', title: __('下单人手机号'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'order.desc', title: __('备注'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'code', title: __('Code'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, diff --git a/public/assets/js/backend/user/user.js b/public/assets/js/backend/user/user.js index f980b22..54ea5dc 100644 --- a/public/assets/js/backend/user/user.js +++ b/public/assets/js/backend/user/user.js @@ -38,6 +38,7 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde {field: 'settle_info.settled_amount', title: __('可提现金额'), operate: false}, {field: 'settle_info.expected_incoming_amount', title: __('预期收益'), operate: false}, {field: 'settle_info.accumulated_incoming_amount', title: __('累计收入'), operate: false}, + {field: 'business_type', title: __('商户进件完善'), searchList: {"1":__('已完善'),"2":__('未完善')}, formatter: Table.api.formatter.status}, diff --git a/public/assets/js/manystore/school/activity/order/order_code.js b/public/assets/js/manystore/school/activity/order/order_code.js index 28c001e..d0adfa7 100644 --- a/public/assets/js/manystore/school/activity/order/order_code.js +++ b/public/assets/js/manystore/school/activity/order/order_code.js @@ -43,6 +43,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'orderuser.mobile', title: __('下单人手机号'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'schoolactivityorder.desc', title: __('备注'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'code', title: __('Code'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},