123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace app\api\controller;
- use think\facade\Lang;
- /**
-
- *
-
- *
- * ----------------------------------------------------------------------------
- *
-
- * 卖家日志控制器
- */
- class Sellerlog extends MobileSeller
- {
- public function initialize()
- {
- parent::initialize();
- }
- /**
- * @api {POST} api/Sellerlog/log_list 店铺日志列表
- * @apiVersion 1.0.0
- * @apiGroup Sellerlog
- *
- * @apiHeader {String} X-DS-KEY 卖家授权token
- *
- * @apiParam {Int} cate_id 分类ID
- * @apiParam {String} seller_name 卖家账号
- * @apiParam {String} log_content 日志内容
- * @apiParam {String} add_time_from 开始时间 YYYY-MM-DD
- * @apiParam {String} add_time_to 结束时间 YYYY-MM-DD
- * @apiParam {Int} page 页码
- * @apiParam {Int} pagesize 每页显示数量
- *
- * @apiSuccess {String} code 返回码,10000为成功
- * @apiSuccess {String} message 返回消息
- * @apiSuccess {Object} result 返回数据
- * @apiSuccess {Object[]} result.log_list 日志列表 (返回字段参考sellerlog表)
- * @apiSuccess {Int} result.page_total 总页数
- * @apiSuccess {Boolean} result.hasmore 是否有更多 true是false否
- */
- public function log_list()
- {
- $sellerlog_model = model('sellerlog');
- $condition = array();
- $condition[] = array('sellerlog_store_id', '=', $this->store_info['store_id']);
- $seller_name = input('param.seller_name');
- $log_content = input('param.log_content');
- $add_time_from = input('param.add_time_from');
- $add_time_to = input('param.add_time_to');
- if (!empty($seller_name)) {
- $condition[] = array('sellerlog_seller_name', 'like', '%' . input('param.seller_name') . '%');
- }
- if (!empty($log_content)) {
- $condition[] = array('sellerlog_content', 'like', '%' . $log_content . '%');
- }
- if (!empty($add_time_from) || $add_time_to) {
- $condition[] = array('sellerlog_time', 'between', [strtotime($add_time_from), strtotime($add_time_to)]);
- }
- $log_list = $sellerlog_model->getSellerlogList($condition, 10, 'sellerlog_id desc');
- $result = array_merge(array('log_list' => $log_list), mobile_page($sellerlog_model->page_info));
- ds_json_encode(10000, lang('ds_common_op_succ'), $result);
- }
- }
|