public function actionIndex()
 {
     $models_type = new FinPartType();
     //实例化分类
     $models_region = new Region();
     //实例化地区
     $models_part = new FinJobDetails();
     //实例化兼职
     $types = $models_type->partComment();
     $region_id = '52';
     $regions = $models_region->getRegion($region_id);
     //接受查询分类
     $keyword = Yii::$app->request->get('1');
     $new_key = Yii::$app->request->get('2');
     if ($new_key) {
         foreach ($new_key as $key => $value) {
             $keyword[$key] = $value;
         }
     }
     if (empty($keyword['type'])) {
         $keyword['type'] = 0;
     }
     if (empty($keyword['region'])) {
         $keyword['region'] = 0;
     }
     $parts = $models_part->getParts($keyword);
     $pages = $parts['pages'];
     unset($parts['pages']);
     return $this->render('index', ['types' => $types, 'regions' => $regions, 'parts' => $parts, 'keyword' => $keyword, 'pages' => $pages]);
 }
 public function actionIndex()
 {
     //获取用户id
     $session = Yii::$app->session->get('userinfo');
     $user_id = $session['user_id'];
     $where = ['=', 'user_id', $user_id];
     $GoodsOrder = new GoodsOrder();
     $paginations = new Pagination(['defaultPageSize' => 5, 'totalCount' => $GoodsOrder->Count($where)]);
     $Gorder = $GoodsOrder->Gorder($where, $paginations);
     $ParttimeOrder = new ParttimeOrder();
     $pagination = new Pagination(['defaultPageSize' => 5, 'totalCount' => $ParttimeOrder->Count($where)]);
     $Porder = $ParttimeOrder->Porder($where, $pagination);
     $FinPartType = new FinPartType();
     $type = $FinPartType->partComment();
     $FinJobDetails = new FinJobDetails();
     $part = $FinJobDetails->getPart();
     return $this->render('index', ['gorder' => $Gorder, 'porder' => $Porder, 'type' => $type, 'part' => $part]);
 }
Example #3
0
 public function getPart()
 {
     $cond = '1=1 and job_status=1';
     $pages = new Pagination(['defaultPageSize' => 5, 'totalCount' => $this->find()->where($cond)->count()]);
     return FinJobDetails::find()->where($cond)->offset($pages->offset)->limit($pages->limit)->orderBy(['add_time' => SORT_DESC])->asArray()->all();
 }
 /**
  * @return string
  * 处理结算业务之前
  *
  */
 public function actionSettlementbefore()
 {
     /* 用户id */
     $user = Yii::$app->request->get("user_id");
     //$user_id = explode(",",$user);
     /* 用户姓名 */
     $name = Yii::$app->request->get("user_name");
     //$user_name = explode(",",$name);
     /* 工作id */
     $job_id = Yii::$app->request->get("job_id");
     /* 根据兼职ID查找商家余额及工资合计 */
     $model = new FinJobDetails();
     $data = $model->getBalance($job_id);
     /* 商家余额 */
     $balance = $data['mer_money'];
     /* 工资合计 */
     $combined = $data['job_money'] * count($user);
     return $this->render("onlinesettlement", ['user' => $user, 'name' => $name, 'balance' => $balance, 'combined' => $combined]);
 }