123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkAdmin
- // +----------------------------------------------------------------------
- // | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
- // +----------------------------------------------------------------------
- // | 官方网站: http://demo.thinkadmin.top
- // +----------------------------------------------------------------------
- // | 开源协议 ( https://mit-license.org )
- // +----------------------------------------------------------------------
- // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
- // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
- // +----------------------------------------------------------------------
- namespace app\user\controller;
- use library\Controller;
- use think\Db;
- use function GuzzleHttp\Psr7\build_query;
- /**
- * 转赠记录管理
- * Class Gift
- * @package app\user\controller
- */
- class GiftLog extends Controller
- {
- /**
- * 绑定数据表
- * @var string
- */
- protected $table = 'GoodsCollect';
- /**
- * 作品列表
- * @auth true
- * @menu true
- * @throws \think\Exception
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- * @throws \think\exception\PDOException
- */
- public function index()
- {
- $this->title = '溯源';
- $id = input('id');
- $original_id = input('original_id');
- if($original_id > 0){
- $list = Db::table('goods_collect')
- ->alias('i')
- ->field('i.*,m.name as user_name,m.headimg,m.phone')
- ->join('store_member m','m.id = i.user_id','LEFT')
- ->where('original_id|i.id',$original_id)
- ->order('i.id asc')->select();
- }else{
- $list = Db::table('goods_collect')
- ->alias('i')
- ->field('i.*,m.name as user_name,m.headimg,m.phone')
- ->join('store_member m','m.id = i.user_id','LEFT')
- ->where('i.id',$id)
- ->order('i.id asc')->select();
- }
- $this->assign('list',$list);
- $this->fetch('index');
- }
- /**
- * 数据列表处理
- * @auth true
- * @menu true
- * @param array $data
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\ModelNotFoundException
- * @throws \think\exception\DbException
- */
- protected function _index_page_filter(&$data)
- {
- }
- //删除货主
- public function remove()
- {
- $this->_save($this->table, ['status' => '3']);
- }
- public function edit(){
- $this->title = '编辑';
- $this->_form($this->table, 'form');
- }
- protected function _form_filter(&$data)
- {
- }
- }
|