Commit d538d0ee by 杨树贤

chain文件

parent 3497b485
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Http\Services\LogService;
use App\Http\Services\SupplierApplyService;
use App\Http\Services\SupplierExaminationService;
use App\Http\Transformers\SupplierLogTransformer;
use App\Http\Validators\SupplierExaminationValidator;
use App\Model\LogModel;
use App\Model\SupplierAccountModel;
use App\Model\SupplierApplyModel;
use App\Model\SupplierLogModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
//供应商检测
class ChainApiController extends Controller
{
public function Entrance(Request $request, $id)
{
$this->$id($request, $id);
}
//获取列表
public function GetSupplierApplyList($request)
{
$service = new SupplierApplyService();
$list = $service->getSupplierApplyList($request->all());
$this->response(0, 'ok', $list['data'], $list['total']);
}
}
<?php
namespace App\Http\Controllers;
use App\Http\Services\RoleService;
use App\Http\Services\SupplierContactService;
use App\Http\Services\SupplierService;
use App\Http\Services\ViewCheckService;
use App\Model\IntracodeModel;
use App\Model\SupplierApplyModel;
use App\Model\SupplierChannelModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ChainController extends Controller
{
public function info(Request $request, $id = '')
{
if ($request->path() == '/') {
$path = 'web/index';
} else {
$path = $request->path();
}
$this->data = [
'menus' => $request->menus,
'header' => $request->user->header,
'username' => $request->user->email,
'user_email' => $request->user->email,
'uri' => '/' . $path,
'id' => $id
];
return $this->$id($request);
}
public function __call($name, $arr)
{
$data['errinfo'] = '访问路径错误';
return view('errors.error', $data);
}
//操作日志列表
public function ChainList($request)
{
$this->data['title'] = '供应商申请列表';
return $this->view('供应商申请列表');
}
}
\ No newline at end of file
<?php
namespace App\Http\Services;
//后台用户相关信息服务
use App\Http\Controllers\Filter\ChainFilter;
use App\Http\Transformers\ChainTransformer;
class ChainService
{
//供应商申请列表
public function getChainList($map)
{
$limit = array_get($map, 'limit', 10);
$filter = new ChainFilter();
$query = $filter->listFilter($map);
$list = $query->paginate($limit)->toArray();
$transformer = new ChainTransformer();
$list['data'] = $transformer->transformList($list['data']);
return $list;
}
}
\ No newline at end of file
<?php
namespace App\Http\Transformers;
use App\Model\RedisModel;
use App\Model\SupplierApplyModel;
use App\Model\SupplierChannelModel;
class ChainTransformer
{
public function transformList($list)
{
$redis = new RedisModel();
foreach ($list as &$item) {
$item['create_time'] = $item['create_time'] ? date('Y-m-d H:i:s', $item['create_time']) : '';
}
unset($item);
return $list;
}
}
\ No newline at end of file
<?php
namespace App\Model;
use App\Http\Services\AdminUserService;
use App\Http\Services\DepartmentService;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Redis;
class ChainModel extends Model
{
protected $table = 'lie_chain';
protected $primaryKey = 'chain_id';
public $timestamps = false;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment