application/store/controller/web/Admin.php

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * 易想会员管理营销系统
 * =========================================================
 * 天津市华易动力信息科技有限公司 , 保留所有权利。
 * ----------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
 * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
 * =========================================================
 * @author : hy_team
 * @date : 2019-08-10
 */
namespace app\store\controller\web;

use app\common\controller\CommonStore;
use app\common\model\StoreAdmin;
use app\common\model\Store;

/**
 * 员工列表
 */
class Admin extends CommonStore
{
	// 列表页 
	public function index()
	{
		// 初始数据
		$admin = session('hysc_store_admin_login');
		$storeList = Store::column('id,identifier,name','id');
		$where = [];
		$where[] = ['store_id','=',$admin['store_id']];

		$list = StoreAdmin::where($where)->paginate(20, false,$where);
		
		foreach ($list as $key => $value) {
			$list[$key]['identifier'] = $storeList[$value['store_id']]['identifier'];
		}
		$this->assign('list',$list);
		return view();
	}
	// 新增员工
	public function add()
	{
		$admin = session('hysc_store_admin_login');
		if ($this->request->isPost()) {
			$data = $this->request->post();
			// 验证
			if (!($data['type'] && $data['name'] && $data['password'] && $data['status'])) {
				$this->error('上传参数不能为空');
			}
			if (!is_numeric($data['type']) && !is_numeric($data['status'])) {
				$this->error('上传参数有误');
			}
			if ($data['password'] != $data['respassword']) {
				$this->error('密码不一致');
			}

			//权限
			$authorityArr = $data['authority'];
			$authority = '';
后面还有 122 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。